// ==========================================================================
// Home.cs
// Silverlight Shapes Library
// ==========================================================================
// Copyright (c) Silverlight Shapes Development Group
// All rights reserved.
// ==========================================================================

using System.ComponentModel;
using System.Windows.Controls;
using System.ComponentModel.Composition;

namespace SD.Samples.Views
{
    /// <summary>
    /// Interaction logic for Home.xaml
    /// </summary>
    public partial class Home : Page
    {        
        #region Properties

        /// <summary>
        /// Gets or sets the view model that is injected by the managed extensibility framework.
        /// </summary>
        /// <value>
        /// The view model that is injected by the managed extensibility framework.
        /// </value>
        [Import]
        public HomeViewModel ViewModel
        {
            get { return DataContext as HomeViewModel; }
            set { DataContext = value; }
        }

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="Home"/> class.
        /// </summary>
        public Home()
        {
            InitializeComponent();

            if (!DesignerProperties.IsInDesignTool)
            {
                CompositionInitializer.SatisfyImports(this);
            }
        }

        #endregion
    }
}